// Copyright 2022 a.o.smith ALL Rights Reserved
package com.liuxinlong.enums;

/**
 * 定时任务状态枚举
 *
 * @author liuxinlong@hotwater.com.cn
 * @version 1.0.0
 * @since 2022-10-09
 */
public enum TaskStatusEnum {
    DISABLED(0, "未启用"),
    READY(1, "就绪"),
    PAUSED(2, "暂停"),
    SUSPEND(3, "挂起");
    private int value;

    private String name;

    TaskStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public static String getNameByValue(int value) {
        TaskStatusEnum arrObj[] = TaskStatusEnum.values();
        for (TaskStatusEnum obj : arrObj) {
            if (value == obj.getValue()) {
                return obj.getName();
            }
        }
        return " ";
    }

}
